package com.wanxi.test;

import java.util.Random;
import java.util.Scanner;

public class Guess {
    public static void main(String[] args) {
        Random random = new Random();
        int randomNum = random.nextInt(100) + 1;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num = scanner.nextInt();

        if (randomNum > num) {
            System.out.println("你猜小了");
        } else if (randomNum < num) {
            System.out.println("你猜大了");
        } else {
            System.out.println("你猜中了");
        }
    }
}
